1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a computer-readable storage device for detecting a contour edge from a target image.
2. Description of the Related Art
In general, an edge in an image is detected by detecting a position at which a change in a gradient is the greatest (a position at which a gradient is steep and a value of the gradient is greater than those of adjacent positions). Basically, edges are detected by calculating gradient magnitudes from gradients of luminance values in an image and performing thresholding on the gradient magnitudes. When contour edges are detected from an image by using the above edge detection method, the contour edges may be discontinued due to various causes, such as the degree of precision of an edge detection algorithm, noise, or an unclear image (blurring), or due to a subjective contour portion. As a method of connecting such discontinued and discrete contour edges, an active contour method and an edge tracing method have been known. However, in the technique using the conventional active contour method, there is a problem in that it is difficult to appropriately discriminate edges that need to be connected from noise edges. Meanwhile, the edge tracing method is a method of tracing an edge on the basis of a direction in which the edge extends or on the basis of information on an orthogonal direction with respect to a differential. Thus, the edge tracing method is dependent on local information and therefore is disadvantageous to noise, so that edges that need to be connected may not be detected in some cases.
As a technology for solving the above conventional problems, Japanese Laid-open Patent Publication No. 2009-015735 discloses a method of appropriately determining a correspondence relation between edge-discontinued positions in order to connect (link) edges. In the technology disclosed in Japanese Laid-open Patent Publication No. 2009-015735, an area to be measured is divided into a plurality of small areas and numbers are assigned to the respective small areas. Subsequently, an individual edge label is assigned to each edge and a small area containing discontinued edges is extracted on the basis of distributions of the edges in each small area. Thereafter, edges that need to be connected are estimated from among adjacent edge labels in the extracted small area, and the estimated edges that need to be connected are smoothly connected to each other by using a Bezier curve or the like.